package com.naiterui.ehp.bs.doctor.controller;

import com.naiterui.ehp.bp.constants.SwaggerTag;
import com.naiterui.ehp.bp.constants.SwaggerTags;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.naiterui.ehp.bp.support.exception.PublicService;
import com.naiterui.ehp.bp.support.exception.ResponseVO;
import com.naiterui.ehp.bs.doctor.exception.ExceptionCodes;
import com.naiterui.ehp.bs.doctor.service.IRePurchaseService;

@Api(tags = {SwaggerTag.DOCTOR + SwaggerTag.INNER_API + SwaggerTag.MEDICINE_REMIND})
@Controller
@RequestMapping("ad/cronTable")
public class AdCronTableController {

    /**
     * 日志对象：<code>logger</code>
     */
    private static final Logger LOGGER = LoggerFactory.getLogger(AdCronTableController.class);


    @Autowired
    private IRePurchaseService rePurchaseService;

    /**
     * 指定日期类推荐未购药提醒
     * CronTableController.getRecomRemind()
     *
     * @param status 类型 1--一小时提醒 2--次日提醒
     *
     * @return
     *
     * @Author fanjd
     * @Date 2017年6月17日
     * @since 1.0.0
     */
    @ApiOperation(value = "指定日期类推荐未购药提醒", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "status", value = "类型(1:一小时提醒, 2:次日提醒)", dataType = "int", paramType = "query", required = true),
    })
    @RequestMapping("recomRemind")
    @ResponseBody
    public ResponseVO<Void> getRecomRemind(Integer status) {
        this.rePurchaseService.getRecomRemind(status);
        return PublicService.returnResponseVO(ExceptionCodes.SUCCESS);
    }


}
